import request from "@/request/request";
import qs from "qs"

 
export function getFlavorList(data){
    let url = "/admin/flavor";
    let param = {
        url:url,
        method:"GET",
        params:data
    }
    return request(param);
}



export function saveFlavor(id,flavor){
    let method = "post";
    let url = "/admin/flavor";
    if(id){
        method = "put";
        url = "/admin/flavor/"+id;
    }

    let param = {
        url:url,
        method:method,
        data:qs.stringify(flavor)
    }
    return request(param);
}


export function deleteFlavorById(id){
    let param = {
        url:"/admin/flavor/"+id,
        method:"delete"
    }
    return request(param);
}






